package com.hzqx.syndata.javabasic;

import com.hzqx.syndata.project.domain.User;

/**
 * 值传递和引用传递
 * @author yinzhiping
 */
public class Example {
    String str = "hello";//new String("hello");
    char[] ch = {'a', 'b'};

    public static void main(String[] args) {
        User  user = new User("32432","afsdf");
        int b = 1;
        Example ex = new Example();
        ex.change(ex.str, ex.ch,b);
        ex.changeUser(user);
        System.out.println(ex.str + " and");
        System.out.println(ex.ch);
        System.out.println(b);
        System.out.println(user);
    }

    public void change(String str, char[] ch,int b) {
        str = "ok";
        ch[0] = 'c';
        b=3;
    }
    public void changeUser(User user){
        user = new User("111111","dfsd");
    }
}
